package top.orange.picacg.model;

import javax.persistence.*;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.jpa.model.BaseModel;

/**
 * @author dell
 */
@Erupt(name = "用户表")
@Table(name = "p_user")
@Entity
public class UserModel extends BaseModel {

    @EruptField(
            views = @View(
                    title = "用户名"
            ),
            edit = @Edit(
                    title = "用户名",
                    type = EditType.INPUT, search = @Search, notNull = true,
                    inputType = @InputType
            )
    )
    private String name;

    @EruptField(
            views = @View(
                    title = "用户密码"
            ),
            edit = @Edit(
                    title = "用户密码",
                    type = EditType.INPUT, notNull = true,
                    inputType = @InputType
            )
    )
    private String password ;

    @EruptField(
            views = @View(
                    title = "邮箱"
            ),
            edit = @Edit(
                    title = "邮箱",
                    type = EditType.INPUT, search = @Search, notNull = true,
                    inputType = @InputType
            )
    )
    private String email;

    @EruptField(
            views = @View(
                    title = "电话号码"
            ),
            edit = @Edit(
                    title = "电话号码",
                    type = EditType.INPUT, search = @Search,
                    inputType = @InputType
            )
    )
    private String phone;

    @EruptField(
            views = @View(
                    title = "状态"
            ),
            edit = @Edit(
                    title = "状态", search = @Search, notNull = true,
                    boolType = @BoolType(trueText = "激活", falseText = "注销")
            )
    )
    private Boolean status;

    @EruptField(
            views = @View(
                    title = "登陆时间"
            ),
            edit = @Edit(
                    title = "登陆时间",
                    type = EditType.DATE,
                    dateType = @DateType(type = DateType.Type.TIME)
            )
    )
    private String loginTime;

    @EruptField(
            views = @View(
                    title = "登陆IP"
            ),
            edit = @Edit(
                    title = "登陆IP",
                    type = EditType.INPUT, search = @Search,
                    inputType = @InputType
            )
    )
    private String loginIp;

}